//-
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

include /app/helpers/jade/mixins
include /app/configuration/mixins

-var form = 'general'
-var model = 'backupItem'

panel-collapsible(opened=`::true` ng-form=form)
    panel-title General
    panel-description
        | General IGFS configuration.
        a.link-success(href="https://apacheignite-fs.readme.io/docs/in-memory-file-system" target="_blank") More info
    panel-content.pca-form-row
        .pca-form-column-6.pc-form-grid-row
            .pc-form-grid-col-60
                +form-field__text({
                    label: 'Name:',
                    model: `${model}.name`,
                    name: '"igfsName"',
                    placeholder: 'Input name',
                    required: true
                })(
                    ignite-unique='$ctrl.igfss'
                    ignite-unique-property='name'
                    ignite-unique-skip=`["_id", ${model}]`
                )
                    +form-field__error({ error: 'igniteUnique', message: 'IGFS name should be unique.' })
            .pc-form-grid-col-30
                +form-field__dropdown({
                    label: 'IGFS mode:',
                    model: `${model}.defaultMode`,
                    name: '"defaultMode"',
                    placeholder: '{{::$ctrl.IGFSs.defaultMode.default}}',
                    options: '{{::$ctrl.IGFSs.defaultMode.values}}',
                    tip: `
                    Mode to specify how IGFS interacts with Hadoop file system
                    <ul>
                        <li>PRIMARY - in this mode IGFS will not delegate to secondary Hadoop file system and will cache all the files in memory only</li>
                        <li>PROXY - in this mode IGFS will not cache any files in memory and will only pass them through to secondary file system</li>
                        <li>DUAL_SYNC - in this mode IGFS will cache files locally and also <b>synchronously</b> write them through to secondary file system</li>
                        <li>DUAL_ASYNC - in this mode IGFS will cache files locally and also <b> asynchronously </b> write them through to secondary file system</li>
                    </ul>
                    `
                })
            .pc-form-grid-col-30
                +form-field__number({
                    label: 'Group size:',
                    model: `${model}.affinnityGroupSize`,
                    name: '"affinnityGroupSize"',
                    placeholder: '{{::$ctrl.IGFSs.affinnityGroupSize.default}}',
                    min: '{{::$ctrl.IGFSs.affinnityGroupSize.min}}',
                    tip: `
                        Size of the group in blocks<br/>
                        Required for construction of affinity mapper in IGFS data cache
                    `
                })
        .pca-form-column-6
            +preview-xml-java(model, 'igfsGeneral')
